```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RocketMQ与Kafka架构差异深度解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            background-color: #f9fafb;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e48aa 0%, #9d50bb 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .highlight-box {
            border-left: 4px solid #6e48aa;
            transition: all 0.3s ease;
        }
        .highlight-box:hover {
            background-color: #f3f4f6;
        }
        .comparison-table {
            border-collapse: separate;
            border-spacing: 0 1rem;
        }
        .comparison-table tr {
            transition: all 0.2s ease;
        }
        .comparison-table tr:hover {
            background-color: #f3f4f6;
        }
        .comparison-table td {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .comparison-table td:first-child {
            border-top-left-radius: 8px;
            border-bottom-left-radius: 8px;
        }
        .comparison-table td:last-child {
            border-top-right-radius: 8px;
            border-bottom-right-radius: 8px;
        }
        .section-divider {
            position: relative;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(110, 72, 170, 0.5), transparent);
            margin: 4rem 0;
        }
        .section-divider::after {
            content: '';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 50px;
            height: 50px;
            background: #f9fafb;
            border-radius: 50%;
            border: 1px solid rgba(110, 72, 170, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            color: #6e48aa;
        }
        .architecture .section-divider::after {
            content: '\f085';
        }
        .features .section-divider::after {
            content: '\f0ad';
        }
        .performance .section-divider::after {
            content: '\f201';
        }
        .dropdown-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }
        .dropdown.active .dropdown-content {
            max-height: 1000px;
            transition: max-height 0.5s ease-in;
        }
        .dropdown.active .chevron {
            transform: rotate(180deg);
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <header class="hero-gradient text-white py-20 px-4 sm:px-6 lg:px-8">
        <div class="max-w-5xl mx-auto text-center">
            <h1 class="serif text-4xl sm:text-5xl lg:text-6xl font-bold leading-tight mb-6">
                RocketMQ<span class="opacity-80">与</span>Kafka
            </h1>
            <p class="text-xl sm:text-2xl opacity-90 max-w-3xl mx-auto mb-10">
                分布式消息队列系统架构差异与核心特性深度解析
            </p>
            <div class="flex flex-wrap justify-center gap-4">
                <div class="bg-white bg-opacity-10 backdrop-blur-sm rounded-lg px-6 py-3 flex items-center">
                    <i class="fas fa-project-diagram mr-2"></i>
                    <span>架构对比</span>
                </div>
                <div class="bg-white bg-opacity-10 backdrop-blur-sm rounded-lg px-6 py-3 flex items-center">
                    <i class="fas fa-tasks mr-2"></i>
                    <span>功能特性</span>
                </div>
                <div class="bg-white bg-opacity-10 backdrop-blur-sm rounded-lg px-6 py-3 flex items-center">
                    <i class="fas fa-tachometer-alt mr-2"></i>
                    <span>性能分析</span>
                </div>
            </div>
        </div>
    </header>

    <!-- Main Content -->
    <main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
        <!-- Introduction -->
        <section class="mb-20">
            <div class="prose prose-lg max-w-4xl mx-auto">
                <p class="text-gray-600 leading-relaxed">
                    RocketMQ和Kafka作为两款主流的分布式消息队列系统，在架构设计上存在显著差异，这些差异直接影响了它们的性能特性和适用场景。本文将从架构设计、功能特性和性能表现三个维度进行全面对比分析，帮助您根据业务需求做出合理的技术选型决策。
                </p>
            </div>
        </section>

        <!-- Architecture Comparison -->
        <section class="architecture mb-20">
            <div class="flex items-center mb-12">
                <div class="flex-shrink-0 bg-purple-100 rounded-lg p-3">
                    <i class="fas fa-project-diagram text-purple-600 text-2xl"></i>
                </div>
                <h2 class="ml-4 serif text-3xl font-bold text-gray-800">架构差异</h2>
            </div>

            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                <i class="fas fa-rocket text-purple-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">RocketMQ架构</h3>
                        </div>
                        <div class="prose text-gray-600">
                            <ul>
                                <li><strong>NameServer</strong>：轻量级的服务发现和路由注册中心</li>
                                <li><strong>Broker</strong>：主从架构的消息存储服务器</li>
                                <li>支持Push和Pull两种消费模式</li>
                                <li>CommitLog + ConsumeQueue存储结构</li>
                                <li>主从集群架构，支持多种复制策略</li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                <i class="fab fa-kickstarter-k text-blue-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">Kafka架构</h3>
                        </div>
                        <div class="prose text-gray-600">
                            <ul>
                                <li><strong>ZooKeeper</strong>：集群元数据管理和协调</li>
                                <li><strong>Broker</strong>：分区作为存储单元</li>
                                <li>只支持Pull消费模式</li>
                                <li>基于分区的日志段存储</li>
                                <li>Leader-Follower分区架构</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Core Components -->
            <div class="mb-12">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">核心架构组件对比</h3>
                <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                    <div class="p-6">
                        <div class="mermaid">
                            graph TD
                                subgraph RocketMQ
                                    A[NameServer] -->|路由信息| B[Broker Master]
                                    B -->|同步复制| C[Broker Slave]
                                    D[Producer] -->|发送消息| A
                                    E[Consumer] -->|消费消息| A
                                end
                                
                                subgraph Kafka
                                    F[ZooKeeper] -->|协调| G[Broker]
                                    G -->|分区Leader| H[Broker]
                                    I[Producer] -->|发送消息| G
                                    J[Consumer] -->|消费消息| G
                                end
                        </div>
                    </div>
                </div>
            </div>

            <!-- Storage Architecture -->
            <div class="mb-12">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">存储架构差异</h3>
                <div class="grid md:grid-cols-2 gap-8">
                    <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                        <div class="p-6">
                            <h4 class="text-lg font-semibold text-purple-600 mb-4">RocketMQ存储架构</h4>
                            <div class="prose text-gray-600">
                                <ul>
                                    <li>CommitLog + ConsumeQueue + IndexFile结构</li>
                                    <li>所有消息顺序写入CommitLog</li>
                                    <li>不同Topic的消息混合存储</li>
                                    <li>支持基于消息Key的索引查询</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                        <div class="p-6">
                            <h4 class="text-lg font-semibold text-blue-600 mb-4">Kafka存储架构</h4>
                            <div class="prose text-gray-600">
                                <ul>
                                    <li>分区（Partition）作为存储单元</li>
                                    <li>每个分区对应物理文件夹</li>
                                    <li>不同Topic的分区物理隔离</li>
                                    <li>基于偏移量（Offset）的消息访问</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="section-divider"></div>
        </section>

        <!-- Features Comparison -->
        <section class="features mb-20">
            <div class="flex items-center mb-12">
                <div class="flex-shrink-0 bg-blue-100 rounded-lg p-3">
                    <i class="fas fa-tasks text-blue-600 text-2xl"></i>
                </div>
                <h2 class="ml-4 serif text-3xl font-bold text-gray-800">功能特性的不同点</h2>
            </div>

            <!-- Message Types -->
            <div class="mb-12">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">消息类型支持</h3>
                <div class="overflow-x-auto">
                    <table class="w-full comparison-table">
                        <thead>
                            <tr class="text-left text-gray-500">
                                <th class="font-medium">特性</th>
                                <th class="font-medium">RocketMQ</th>
                                <th class="font-medium">Kafka</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="font-medium">普通消息</td>
                                <td>支持单向、同步、异步消息</td>
                                <td>支持同步和异步发送</td>
                            </tr>
                            <tr>
                                <td class="font-medium">顺序消息</td>
                                <td>支持全局顺序和分区顺序</td>
                                <td>不原生支持，需特殊设计</td>
                            </tr>
                            <tr>
                                <td class="font-medium">事务消息</td>
                                <td>支持分布式事务</td>
                                <td>0.11版本开始支持</td>
                            </tr>
                            <tr>
                                <td class="font-medium">延时消息</td>
                                <td>支持最长40天的延时</td>
                                <td>不原生支持</td>
                            </tr>
                            <tr>
                                <td class="font-medium">批量消息</td>
                                <td>支持</td>
                                <td>支持</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <!-- Advanced Features -->
            <div class="mb-12">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">高级特性对比</h3>
                <div class="grid md:grid-cols-2 gap-8">
                    <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                        <div class="p-6">
                            <h4 class="text-lg font-semibold text-purple-600 mb-4">RocketMQ特有功能</h4>
                            <div class="prose text-gray-600">
                                <ul>
                                    <li><strong>消息轨迹</strong>：跟踪消息完整链路</li>
                                    <li><strong>消息过滤</strong>：支持Tag和SQL92表达式</li>
                                    <li><strong>定时消息</strong>：支持定时投递</li>
                                    <li><strong>消息重试与死信队列</strong>：完善的异常处理</li>
                                    <li><strong>消息优先级</strong>：支持优先级队列</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                        <div class="p-6">
                            <h4 class="text-lg font-semibold text-blue-600 mb-4">Kafka特有功能</h4>
                            <div class="prose text-gray-600">
                                <ul>
                                    <li><strong>流处理</strong>：通过Kafka Streams</li>
                                    <li><strong>Connect API</strong>：简化数据导入导出</li>
                                    <li><strong>日志压缩</strong>：针对键值对数据</li>
                                    <li><strong>精确一次语义</strong>：Exactly Once</li>
                                    <li><strong>安全机制</strong>：SASL/SSL等</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="section-divider"></div>
        </section>

        <!-- Performance & Use Cases -->
        <section class="performance">
            <div class="flex items-center mb-12">
                <div class="flex-shrink-0 bg-green-100 rounded-lg p-3">
                    <i class="fas fa-tachometer-alt text-green-600 text-2xl"></i>
                </div>
                <h2 class="ml-4 serif text-3xl font-bold text-gray-800">性能和适用场景</h2>
            </div>

            <!-- Performance Metrics -->
            <div class="mb-12">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">性能对比</h3>
                <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                    <div class="p-6">
                        <div class="mermaid">
                            pie title 性能对比
                                "吞吐量" : 45
                                "延迟" : 25
                                "扩展性" : 20
                                "资源消耗" : 10
                        </div>
                        <div class="grid md:grid-cols-2 gap-8 mt-8">
                            <div>
                                <h4 class="text-lg font-semibold text-purple-600 mb-4">RocketMQ优势</h4>
                                <ul class="space-y-2 text-gray-600">
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                        <span>低延迟场景表现更好</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                        <span>更细粒度的延迟控制</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                        <span>内存占用相对较低</span>
                                    </li>
                                </ul>
                            </div>
                            <div>
                                <h4 class="text-lg font-semibold text-blue-600 mb-4">Kafka优势</h4>
                                <ul class="space-y-2 text-gray-600">
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-blue-500 mt-1 mr-2"></i>
                                        <span>大数据量、高吞吐场景更优</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-blue-500 mt-1 mr-2"></i>
                                        <span>水平扩展能力更强</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-check-circle text-blue-500 mt-1 mr-2"></i>
                                        <span>单机支持每秒数百万条消息</span>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Use Cases -->
            <div class="mb-12">
                <h3 class="text-2xl font-bold text-gray-800 mb-6">适用场景</h3>
                <div class="grid md:grid-cols-2 gap-8">
                    <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                        <div class="p-6">
                            <h4 class="text-lg font-semibold text-purple-600 mb-4">选择RocketMQ的情况</h4>
                            <ul class="space-y-3 text-gray-600">
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-purple-600 text-xs"></i>
                                    </div>
                                    <span>需要丰富的消息类型支持</span>
                                </li>
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-purple-600 text-xs"></i>
                                    </div>
                                    <span>需要完善的消息异常处理机制</span>
                                </li>
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-purple-600 text-xs"></i>
                                    </div>
                                    <span>对消息投递实时性要求较高</span>
                                </li>
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-purple-600 text-xs"></i>
                                    </div>
                                    <span>国内技术团队，便于获取支持</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="bg-white rounded-xl shadow-lg overflow-hidden card-hover">
                        <div class="p-6">
                            <h4 class="text-lg font-semibold text-blue-600 mb-4">选择Kafka的情况</h4>
                            <ul class="space-y-3 text-gray-600">
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-blue-600 text-xs"></i>
                                    </div>
                                    <span>超高吞吐量需求</span>
                                </li>
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-blue-600 text-xs"></i>
                                    </div>
                                    <span>需要长时间存储消息数据</span>
                                </li>
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-blue-600 text-xs"></i>
                                    </div>
                                    <span>与大数据生态系统集成</span>
                                </li>
                                <li class="flex items-start">
                                    <div class="flex-shrink-0 h-6 w-6 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                        <i class="fas fa-check text-blue-600 text-xs"></i>
                                    </div>
                                    <span>国际化团队，英文资料支持</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Selection Advice -->
            <div class="bg-blue-50 rounded-xl p-6 mb-12">
                <h3 class="text-xl font-bold text-gray-800 mb-4">选型建议</h3>
                <div class="prose text-gray-600">
                    <p>
                        RocketMQ和Kafka各有优势，选择时应根据具体业务需求、团队技术栈和运维能力综合考虑，没有绝对的优劣之分，关键是找到最适合自身业务场景的解决方案。
                    </p>
                    <p class="mt-4">
                        在同一个系统中，可以考虑混合使用：用Kafka处理日志和监控数据，用RocketMQ处理业务交易消息，通过消息网关或桥接组件实现两者之间的数据流转。
                    </p>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-400 py-12 px-4 sm:px-6 lg:px-8">
        <div class="max-w-7xl mx-auto">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-white text-lg font-medium">技术小馆</h3>
                    <p class="mt-1">探索技术前沿，分享知识价值</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition-colors duration-200">
                        <i class="fas fa-external-link-alt mr-1"></i>
                        http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="mt-8 pt-8 border-t border-gray-800 text-center text-sm">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });

        // Dropdown functionality
        document.querySelectorAll('.dropdown-toggle').forEach(toggle => {
            toggle.addEventListener('click', () => {
                const dropdown = toggle.closest('.dropdown');
                dropdown.classList.toggle('active');
            });
        });

        // Smooth scroll for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>
```